import { Module, ConsoleLogger } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { AuthService } from './auth.service';
import { AuthResolver } from './auth.resolver';
import { UserService } from '@/modules/user/user.service';
import { JwtStrategy } from './jwt.strategy';
import { TypeOrmModule } from '@nestjs/typeorm';
import { User } from '@/modules/user/models/user.entity';
import { JWT_SECRET } from '@/common/constants/aliyun';

@Module({
  imports: [
    JwtModule.register({
      secret: JWT_SECRET,
      signOptions: { 
        expiresIn: 60 * 60 * 24 * 7 + 's' 
      }
    }),
    TypeOrmModule.forFeature([User])
  ],
  providers: [
    JwtStrategy, 
    ConsoleLogger, 
    AuthService, 
    AuthResolver, 
    UserService
  ],
  exports: []
})
export class AuthModule {}
